YNQ  YNQ-1.6.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups

Macros

#define syGetTimeInSec()   time(0)
 
#define sySleep(_secs_)   sleep(_secs_)
 
#define syUSleep(_msecs_)   usleep(_msecs_)
 

Functions

NQ_TIME syGetTimeInMsec (void)
 
NQ_TIME syConvertTimeSpecToTimeInMsec (void *val)
 
NQ_UINT32 syConvertTimeInMsecToSec (NQ_TIME *timeMsec)
 
NQ_INT syGetTimeZone (void)
 
void syDecomposeTime (NQ_UINT32 time, SYTimeFragments *decomposed)
 
NQ_UINT32 syComposeTime (const SYTimeFragments *decomposed)
 
NQ_BOOL syGmtToString (NQ_BYTE *strTime, NQ_COUNT size, NQ_UINT32 t, const NQ_CHAR *fmt)
 

Detailed Description

Time functions

See Also
syGetTimeAccuracy() in the platform-dependent sypltfrm.h File Operations

Macro Definition Documentation

#define syGetTimeInSec ( )    time(0)

System (Posix) time in seconds from 1-Jan-1970

#define sySleep (   _secs_)    sleep(_secs_)

Wait a number of seconds.

#define syUSleep (   _msecs_)    usleep(_msecs_)

Wait a number of milliseconds.

Function Documentation

NQ_TIME syGetTimeInMsec ( void  )

Get system time in POSIX format in milliseconds

Returns
The number of milliseconds elapsed since Jan 1, 1970 in milliseconds
NQ_TIME syConvertTimeSpecToTimeInMsec ( void *  val)

Convert the Timespec to time in milliseconds

Parameters
valTimespec value format
Returns
The converted time from Timespec to a time in milliseconds
NQ_UINT32 syConvertTimeInMsecToSec ( NQ_TIME timeMsec)

Convert time in milliseconds to seconds

Parameters
timeMsecTime in milliseconds.
Returns
Time in seconds
NQ_INT syGetTimeZone ( void  )

Get time zone difference in minutes

Returns
The number of minutes to be added to the local time to get GMT. This number is negative for GMT+ and positive for GMT-
void syDecomposeTime ( NQ_UINT32  time,
SYTimeFragments decomposed 
)

Decompose system time into fragments

Parameters
timeSystem time
decomposedStructure of file fragments
NQ_UINT32 syComposeTime ( const SYTimeFragments decomposed)

Compose system time from fragments

Parameters
decomposedStructure of file fragments
Returns
Composed system time
NQ_BOOL syGmtToString ( NQ_BYTE strTime,
NQ_COUNT  size,
NQ_UINT32  t,
const NQ_CHAR fmt 
)

This function converts system time into GMT time and prints it according to the format (fmt).

GMT-Y.m.d-H.M.S

Parameters
strTimeThe buffer to return the string.
sizeThe buffer size.
tTime in seconds from Jan 1, 1970 (Unix time).
fmtThe string format.
Returns
TRUE on success, FALSE on error.
Note
The format string in the example is currently the only one that need be supported.